#include<iostream>
#include<vector>

using namespace std;

int main()
{
    vector<int> vec;
    int temp;

    while(1)
    {
	cout << " Write some integer: ";
	cin >> temp;
	if(temp ==-1 )
	    break;
	vec.push_back(temp);
    }


    cout<< "You wrote " << vec.size() << " elements";
    cout << "These are: " << endl;


    for(int i=0; i<vec.size(); i++)
	cout << vec[i] << " ";
	cout <<endl;
	return 0;

}
